Forward repeated key presses as further down keys
authorAndreas Pokorny <andreas.pokorny@canonical.com>
Tue, 19 Jul 2016 12:44:42 +0000 (14:44 +0200)
committerWilliam Hua <william.hua@canonical.com>
Wed, 10 Aug 2016 17:36:38 +0000 (13:36 -0400)
Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
gdk/mir/gdkmireventsource.c

index ce6af0ac44a45a82e4cf003e22e757d1a8bcd8cf..910d3892a59cf834235538839af59a18fa1a523a 100644 (file)
@@ -290,28 +290,17 @@ handle_key_event (GdkWindow *window, const MirInputEvent *event)
   if (!keyboard_event)
     return;
 
-  switch (mir_keyboard_event_action (keyboard_event))
-    {
-    case mir_keyboard_action_up:
-    case mir_keyboard_action_down:
-      // FIXME: Convert keycode
-      _gdk_mir_window_impl_get_cursor_state (impl, NULL, NULL, NULL, &button_state);
-      modifier_state = get_modifier_state (mir_keyboard_event_modifiers (keyboard_event), button_state);
-      keymap = gdk_keymap_get_for_display (gdk_window_get_display (window));
-
-      generate_key_event (window,
-                          mir_keyboard_event_action (keyboard_event) == mir_keyboard_action_down ? GDK_KEY_PRESS : GDK_KEY_RELEASE,
-                          modifier_state,
-                          mir_keyboard_event_key_code (keyboard_event),
-                          mir_keyboard_event_scan_code (keyboard_event),
-                          _gdk_mir_keymap_key_is_modifier (keymap, mir_keyboard_event_key_code (keyboard_event)),
-                          NANO_TO_MILLI (mir_input_event_get_event_time (event)));
-      break;
-    default:
-    //case mir_key_action_multiple:
-      // FIXME
-      break;
-    }
+  _gdk_mir_window_impl_get_cursor_state (impl, NULL, NULL, NULL, &button_state);
+  modifier_state = get_modifier_state (mir_keyboard_event_modifiers (keyboard_event), button_state);
+  keymap = gdk_keymap_get_for_display (gdk_window_get_display (window));
+
+  generate_key_event (window,
+                      mir_keyboard_event_action (keyboard_event) == mir_keyboard_action_up ? GDK_KEY_RELEASE : GDK_KEY_PRESS,
+                      modifier_state,
+                      mir_keyboard_event_key_code (keyboard_event),
+                      mir_keyboard_event_scan_code (keyboard_event),
+                      _gdk_mir_keymap_key_is_modifier (keymap, mir_keyboard_event_key_code (keyboard_event)),
+                      NANO_TO_MILLI (mir_input_event_get_event_time (event)));
 }
 
 static void